import request from '@/uni_modules/zhouWei-request/js_sdk/requestConfig.js'
import store from '@/store'




// 登录
export function login(params) {
	
	return request.post('/user/login', {
		...params
	})
}
// 获取二维码对应的单据--根据单据编号查询发货通知单
export function getQRcoedShippingNoticeList(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/fhtzd/getList', {
		...params
	})
}

// 根据销售出库id获取销售出库信息 
export function getSalesOutboundInfo(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/xsck/getDatas', {
		...params
	})
}

// 发货通知单下推销售出库
export function pushSalesOutbound(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.post('/fhtzd/push', {
		...params
	})
}


// 获取仓库信息 --
export function getWareHouse(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/xsck/getWareHouse', {
		...params
	})
}
// 根据仓库获取仓位信息--
export function getPosition(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/xsck/getPosition', {
		...params
	})
}
// 根据物料id获取对应辅助属性 code 1颜色，2门幅，3尺码
export function getAuxiliaryProperties(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/xsck/getAuxiliaryProperties', {
		...params
	})
}

// 根据布卷单据编号获取布卷信息
export function getClothRoll(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/xsck/getClothRoll', {
		...params
	})
}

// 根据布卷单据编号获取布卷信息--王杰超
export function getColothRollInfoApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/packingList/getColothRollInfo', {
		...params
	})
}


// 销售出库单保存、删除
export function operationSalesOutboundOrder(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.post('/fhtzd/save', {
		...params
	})
}


// 生成装箱单---王杰超
export function packingCreateBoxOrderApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.post('/packingList/createBoxOrder', {
		...params
	})
}

// 根据内码fids删除装箱单 
export function deletePackingBoxApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.post('/packingList/deleteBox', {
		...params
	})
}

// 根据内码fids提交装箱单
export function approvalPackingApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.post('/packingList/submit', {
		...params
	})
}




//  查询装箱单---王杰超
export function getPackingListApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/packingList/searchList', {
		...params
	})
}

//  根据装箱单fid查询布卷信息---王杰超
export function getPackingListSearchClothRollApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/packingList/searchClothRoll', {
		...params
	})
}

//  查询当前布卷----查询所有已经装箱布卷--陈东
// 1、不能在当前扫码的装箱单重复，
// 2、不能在生产订单号中所有装箱单中重复
export function getPackingListSearchClothRollVerifyDuplicateApi(params) {
	params.userName = store.state.userName
	params.passWord = store.state.password
	return request.get('/packingList/getScddBj', {
		...params
	})
}







// -------————————————————————————

//  获取首页 第一个 banner

// 条码扫描
export function barcodeScan(params) {
	return request.get('/api/findBillsInfo/', {
		...params
	})
}


// 报存单据
export function saveWareHouse(params) {
	return request.post('/api/save', {
		...params
	})
}

// 提交单据
export function submitWareHouse(params) {
	return request.post('/api/submit', {
		...params
	})
}

// 工序计划下推工序汇报
export function pushProcessReport(params) {
	return request.post('/api/pushProcessReport?' + 'user=' + store.state.userName + '&active=' + store.state.active, {
		...params
	})
}